home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / Snippets / QuickDraw / RotateString / PRotate ƒ / RotateStringPascal.p < prev   
Encoding:
Text File  |  1994-02-09  |  1.5 KB  |  75 lines  |  [TEXT/PJMM]

  1. program RotateStringPascal;
  2.  
  3.     uses
  4.         RotateStringIntf;
  5.  
  6.  
  7.     procedure DrawIT;
  8.         var
  9.             window1, window2: WindowPtr;
  10.             RotatedStrMap: BitMap;
  11.             WindowRect: Rect;
  12.             err: OSErr;
  13.     begin
  14.  
  15.         SetRect(windowRect, 100, 100, 200, 200);
  16.  
  17.         window1 := NewWindow(nil, windowRect, 'C-CW', true, noGrowDocProc, WindowPtr(-1), true, 0);
  18.  
  19.         SetPort(window1);
  20.  
  21.  
  22.         TextFont(4);
  23.         TextFace([bold, italic]);
  24.         TextSize(96);
  25.  
  26.         err := RotateString('Rotate', RotatedStrMap, clockWise);
  27.         if err <> noErr then
  28.             begin
  29.                 DebugStr('Error rotating it');
  30.                 ExitToShell;
  31.             end;
  32.  
  33.         SizeWindow(window1, RotatedStrMap.bounds.right, RotatedStrMap.bounds.bottom, false);
  34.         SetPort(window1);
  35.  
  36.         CopyBits(RotatedStrMap, window1^.portBits, RotatedStrMap.bounds, RotatedStrMap.bounds, srcCopy, nil);
  37.  
  38.         OffsetRect(windowRect, (windowRect.right - windowRect.left) + 40, 0);
  39.  
  40.         window2 := NewWindow(nil, windowRect, 'CW', true, noGrowDocProc, WindowPtr(-1), true, 0);
  41.  
  42.         SetPort(window2);
  43.  
  44.  
  45.         TextFont(4);
  46.         TextFace([bold, italic]);
  47.         TextSize(96);
  48.  
  49.         err := RotateString('Rotate', RotatedStrMap, clockWise);
  50.         if err <> noErr then
  51.             begin
  52.                 DebugStr('Error rotating it');
  53.                 ExitToShell;
  54.             end;
  55.  
  56.         SizeWindow(window2, RotatedStrMap.bounds.right, RotatedStrMap.bounds.bottom, false);
  57.         SetPort(window2);
  58.  
  59.         CopyBits(RotatedStrMap, window2^.portBits, RotatedStrMap.bounds, RotatedStrMap.bounds, srcCopy, nil);
  60.         while not Button do
  61.             ;
  62.  
  63.     end;
  64.  
  65. begin
  66.     InitGraf(@thePort);
  67.     InitFonts;
  68.     InitWindows;
  69.     InitMenus;
  70.     TEInit;
  71.     InitDialogs(nil);
  72.     InitCursor;
  73.     FlushEvents(everyEvent, 0);
  74.     DrawIT;
  75. end.